/*
 * Copyright 2008 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package com.yangfei.SportAssistant.util;

/**
 * Constants used by the SportAssistant application.
 * 
 * @author Leif Hendrik Wilden
 */
public abstract class Constants
{

	public static final String BaiduMap = "BaiduMap";
	public static final String GoogleMap = "GoogleMap";

	public static final String GPS_PROVIDER = "gps";

	/**
	 * Should be used by all log statements
	 */
	public static final String TAG = "SportAssistant";

	/**
	 * Name of the top-level directory inside the SD card where our files will be
	 * read from/written to.
	 */
	public static final String SDCARD_TOP_DIR = "SportAssistant";

	/*
	 * onActivityResult request codes:
	 */
	public static final int SHOW_WAYPOINT = 0;

	/*
	 * Context menu ids. Sorted alphabetically.
	 */
	public static final int MENU_DELETE = 100;
	public static final int MENU_EDIT = 101;
	public static final int MENU_SHOW = 102;

	/*
	 * Main screen tab tags:
	 */

	/*
	 * public static final String MAP_TAB_TAG = "map"; public static final String
	 * STATS_TAB_TAG = "stats"; public static final String CHART_TAB_TAG =
	 * "chart";
	 */
	public static final String TAB_ITEM_MAP = "tabMainUI";
	public static final String TAB_ITEM_INFO = "tabInfo";
	public static final String TAB_ITEM_CHART = "tabCharts";
	public static final String TAB_ITEM_TRACKS = "tabTracks";
	public static final String TAB_ITEM_SETTING = "tabSetting";
	
	public static final int TAB_ITEM_MAP_ID = 0;
	public static final int TAB_ITEM_INFO_ID = 1;
	public static final int TAB_ITEM_CHART_ID = 2;
	public static final int TAB_ITEM_TRACKS_ID = 3;
	public static final int TAB_ITEM_SETTING_ID = 4;

	/**
	 * The number of distance readings to smooth to get a stable signal.
	 */
	public static final int DISTANCE_SMOOTHING_FACTOR = 25;

	/**
	 * The number of elevation readings to smooth to get a somewhat accurate
	 * signal.
	 */
	public static final int ELEVATION_SMOOTHING_FACTOR = 25;

	/**
	 * The number of grade readings to smooth to get a somewhat accurate signal.
	 */
	public static final int GRADE_SMOOTHING_FACTOR = 5;

	/**
	 * The number of speed reading to smooth to get a somewhat accurate signal.
	 */
	public static final int SPEED_SMOOTHING_FACTOR = 25;

	/**
	 * Maximum number of track points displayed by the map overlay.
	 */
	public static final int MAX_DISPLAYED_TRACK_POINTS = 10000;

	/**
	 * Target number of track points displayed by the map overlay. We may display
	 * more than this number of points.
	 */
	public static final int TARGET_DISPLAYED_TRACK_POINTS = 5000;

	/**
	 * Maximum number of track points ever loaded at once from the provider into
	 * memory. With a recording frequency of 2 seconds, 15000 corresponds to 8.3
	 * hours.
	 */
	public static final int MAX_LOADED_TRACK_POINTS = 20000;

	/**
	 * Maximum number of track points ever loaded at once from the provider into
	 * memory in a single call to read points.
	 */
	public static final int MAX_LOADED_TRACK_POINTS_PER_BATCH = 1000;

	/**
	 * Maximum number of way points displayed by the map overlay.
	 */
	public static final int MAX_DISPLAYED_WAYPOINTS_POINTS = 128;

	/**
	 * Maximum number of way points that will be loaded at one time.
	 */
	public static final int MAX_LOADED_WAYPOINTS_POINTS = 10000;

	/**
	 * Any time segment where the distance traveled is less than this value will
	 * not be considered moving.
	 */
	public static final double MAX_NO_MOVEMENT_DISTANCE = 2;

	/**
	 * Anything faster than that (in meters per second) will be considered moving.
	 */
	public static final double MAX_NO_MOVEMENT_SPEED = 0.224;

	/**
	 * Ignore any acceleration faster than this. Will ignore any speeds that imply
	 * accelaration greater than 2g's 2g = 19.6 m/s^2 = 0.0002 m/ms^2 = 0.02
	 * m/(m*ms)
	 */
	public static final double MAX_ACCELERATION = 0.02;

	/** Maximum age of a GPS location to be considered current. */
	public static final long MAX_LOCATION_AGE_MS = 60 * 1000; // 1 minute

	/** Maximum age of a network location to be considered current. */
	public static final long MAX_NETWORK_AGE_MS = 1000 * 60 * 10; // 10 minutes

	/**
	 * The type of account that we can use for gdata uploads.
	 */
	public static final String ACCOUNT_TYPE = "com.google";

	/**
	 * The name of extra intent property to indicate whether we want to resume a
	 * previously recorded track.
	 */
	public static final String RESUME_TRACK_EXTRA_NAME = "com.yangfei.SportAssistant.RESUME_TRACK";

	public static final String MAPSHOP_BASE_URL = "https://maps.google.com/maps/ms";

	/*
	 * Default values - keep in sync with those in preferences.xml.
	 */

	public static final int DEFAULT_ANNOUNCEMENT_FREQUENCY = -1;
	public static final int DEFAULT_AUTO_RESUME_TRACK_TIMEOUT = 10; // In min.
	public static final int DEFAULT_MAX_RECORDING_DISTANCE = 200;
	public static final int DEFAULT_MIN_RECORDING_DISTANCE = 5;
	public static final int DEFAULT_MIN_RECORDING_INTERVAL = 0;
	public static final int DEFAULT_MIN_REQUIRED_ACCURACY = 200;
	public static final int DEFAULT_SPLIT_FREQUENCY = 0;

	public static final String SETTINGS_NAME = "SettingsActivity";

	public static String mStrKey = "85C264E01259352FA31A0650529071AB26960F17";

	public enum MapListsenerType
	{
		EGoogleMap, EBaiduMap, EOsmMap, EMapQuestMap
	};

	public static final String MAPPROVIDER = "mapprovider";
	public static final int BAIDU = 0;
	public static final int OSM = 1;
	public static final int MAPQUEST = 2;
	public static final int GOOGLE = 3;

	public static final String BAIDU_PROVIDER = "BaiduMap";
	public static final String GOOGLE_PROVIDER = "GoogleMap";
	public static final String OSM_PROVIDER = "Osm";
	public static final String MAPQUEST_PROVIDER = "MapQuest";

	// for osm map
	public static final int OSM_CLOUDMADE = 0;
	public static final int OSM_MAKNIK = 1;
	public static final int OSM_CYCLE = 2;
	public static final String OSMBASEOVERLAY = "OSM_BASE_OVERLAY";

	public static final String AUTHORITY = "com.yangfei.sportassistant.mapcontent";
  //for map view
  public static final String SATELLITE = "SATELLITE";
  public static final String TRAFFIC = "TRAFFIC";
	/*
	 * for debug
	 */

	public static final int SKIPDATAHUB = 1;

	/**
	 * This is an abstract utility class.
	 */
	protected Constants()
	{}
}
